package cc.wsyw126.java.nowcoder.offerdidi.two;

import java.util.Scanner;

/**
 * Created by dp on 2017/4/22.
 */
public class one {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String s = sc.nextLine();
            StringBuilder sb = new StringBuilder(s);
            int left = 0, right =0;
            for (int i = 0; i <= sb.length(); i++) {
                if (i != sb.length() && sb.charAt(i) != ' ') {
                    right++;
                } else {
                    change(sb, left, right-1);
                    left=++right;
                }

            }
            System.out.println(sb.toString());
        }
    }

    private static void change(StringBuilder sb, int left, int right) {
        while (left<right) {
            char c = sb.charAt(left);
            sb.replace(left, left+1, String.valueOf(sb.charAt(right)));
            sb.replace(right, right+1, String.valueOf(c));
            left++;
            right--;
        }
    }


}
